package com.wgworkshop.pems.common.enums;

/**
 * 班级安排状态枚举。
 * Created by wlc on 2017/10/11.
 */
public enum ClassArrangeStatusEnum {
    INVALID(0), EFFECTIVE(1);

    private final Integer code;

    ClassArrangeStatusEnum(Integer code) {
        this.code = code;
    }

    public static ClassArrangeStatusEnum fromCode(Integer code) {
        if (code == 0) {
            return INVALID;
        }
        if (code == 1) {
            return EFFECTIVE;
        }
        throw new UnsupportedOperationException("The code " + code + " is not supported.");
    }

    public Integer getCode() {
        return code;
    }
}
